1. Field of the Invention
The present invention relates generally to a method and apparatus for processing still digital images, and more particularly, to compressing such still digital images.
2. Description of the Related Art
Current image-capturing devices generally produce high-resolution images, which require large amounts of memory for storage and for processing. Images are compressed using suitable techniques.
When compressing an image, it is important to consider file size and the image quality of the compresses image. The compression technique used should be able to compress images to a much lower size, while preserving the quality at an acceptable level. Images are compressed using lossy or lossless compression techniques.
Image compression techniques use various tools such as block based Discrete Cosine Transform (DCT), Quantization and variable length encoding or Huffman encoding. In DCT, the image is separated into spectral sub-bands of differing importance with respect to the image's visual quality. DCT process transforms the data into different domains where much of the energy of signal/image block is concentrated to only few of the coefficients.
Quantization is an approximation technique where the dynamic range of the input data is reduced by down-scaling the input data magnitude using quantization matrices/factor. Hence, the output of quantization process is represented in a lesser number of bits.
Huffman encoding is a variable length encoding scheme, in which shorter codes are assigned to high-probability events and longer codes are assigned to low-probability events thereby reducing average bit rate. The file size of a compressed image is controlled by quantization matrices/tables and encoding techniques.
Generally, images are compressed as per an application's specification. The application specific compressed images are unsuitable for use in other applications. For example, Multimedia Messaging Service (MMS) application limits the images to be sent to some maximum file size of 300 KB. However, the original image may be captured with high quality and high-resolution, and hence, are much larger than defined limits.
Further, users can share images on the Internet by uploading their images on various image sharing applications such as Picasa, Smugmug and Flickr. As the image sharing applications have limited memory, the user may not be able to share many of their high-resolution images. Owing to such restrictions, the user is required to re-encode the images, so that he/she can maximize the number of images to be stored.
Aforementioned limitations have led to user modifying the images, based upon user's properties, and server storage limitations. An image's file size is modified by modifying the quantization table, which controls the file size by performing a trade-off between distortion and bit-rate. The quantization tables are constructed based upon the Human Visual System (HVS). The human eye is generally good at distinguishing brightness over a relatively large area, against the exact strength of a high frequency brightness variation. Therefore, the high frequency components are more quantized than low-frequency components, to reduce the amount of information.
Although multiple quantization tables are allowed in image compression techniques, some image standards do not allow quantization tables from one Minimum Coded Unit (MCU) to be used in other MCUs. Therefore, the quantization tables decided should be considered uniformly throughout the entire image.
At present, the file size of a compressed digital image is controlled by a variation of the quantization table or an application of scalar multipliers to reference quantization tables. The multipliers may be adjusted and image is re-encoded iteratively until a desired average bit rate is achieved. The number of the passes required for achieving the final rate at minimal distortion is completely image-dependent and hence computational complexity requirements are very high for practical implementations. Further, power source of the image-capturing device may be adversely affected. The computational complexity increases with increase in image resolution.
Various other quantization and perceptual rate distortion optimization techniques developed for Discrete Cosine Transform (DCT) based image codec include scaled quantization, spectral zeroing, and perceptual quantization table design. These methods attempt to estimate the quantization parameters by analyzing the image characteristics. However, some additional compression tools may be used to determine the final encoded file size. The existing methods do not handle such additional tools. The present compression techniques estimate image parameters, but do not provide a mechanism that validate whether the estimated parameters are actually sufficient to obtain the desired file size.
The present compression techniques estimate the parameters and enable compression to a predefined file size, but do not allow a user to vary the quantization parameters, and hence, determine the file size by selecting user's preference image quality factor.